package icu.qx.common.pojo;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.core.annotation.Excel;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.util.Date;

/**
 * 系统编码
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class SysCode implements Serializable {
    private static final Long serialVersionUID = 1365002579208929234L;
    // 主键
    private Long codeId;
    // 关联表名
    @NotBlank(message = "关联表名不为空")
    @Excel(name = "关联表名")
    private String codeTableName;
    // 展示名称
    @NotBlank(message = "展示名称不为空")
    @Size(min = 0, max = 50, message = "展示名称不能超过50个字")
    @Excel(name = "展示名称")
    private String codeShowName;
    // 编号前缀
    @Excel(name = "编号前缀")
    private String codePrefix;
    // 补全符
    private Character codePad;
    // 生成类型
    @Excel(name = "生成类型", readConverterExp = "0=每天生成,1=递增")
    private Character codeGenerateType;
    // 初始流水号
    @Excel(name = "初始流水号")
    private Integer codeInitNum;
    // 流水号步长
    @Excel(name = "步长")
    private Integer codeStep;
    // 当前流水号
    private Integer codeCurrNum;
    // 流水号长度
    @Excel(name = "流水号长度")
    private Integer codeLength;
    // 时间规则
    @Excel(name = "时间规则", readConverterExp = "0=yyyyMMdd,1=yyyyMM,2=yyyyMMddHHmm")
    private Character codeTimeRule;
    // 编号预览
    @Excel(name = "编号预览")
    private String codePreview;
    // 创建时间
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;
    // 创建人
    private String createBy;
    // 修改时间
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date updateTime;
    // 修改人
    private String updateBy;
}
